package cn.sfrog.common.constant;

import io.jsonwebtoken.Claims;

/**
 * 通用常量信息
 */
public class Constants {
    /**
     * UTF-8 字符集
     */
    public static final String UTF8 = "UTF-8";

    /**
     * GBK 字符集
     */
    public static final String GBK = "GBK";

    /**
     * http请求
     */
    public static final String HTTP = "http://";

    /**
     * https请求
     */
    public static final String HTTPS = "https://";

    /**
     * 通用成功标识
     */
    public static final String SUCCESS = "0";

    /**
     * 通用失败标识
     */
    public static final String FAIL = "1";

    /**
     * 登录成功
     */
    public static final String LOGIN_SUCCESS = "Success";

    /**
     * 注销
     */
    public static final String LOGOUT = "Logout";

    /**
     * 注册
     */
    public static final String REGISTER = "Register";

    /**
     * 登录失败
     */
    public static final String LOGIN_FAIL = "Error";

    /**
     * 申请连麦 redis key set用
     */
    public static final String LIVE_WHEAT_SET_KEY = "live_wheat_set:";

    /**
     * 申请连麦 redis key list用
     */
    public static final String LIVE_WHEAT_LIST_KEY = "live_wheat_list:";

    /**
     * 验证码 redis key
     */
    public static final String CAPTCHA_CODE_KEY = "captcha_codes:";

    /**
     * 登录用户 redis key
     */
    public static final String LOGIN_TOKEN_KEY = "login_tokens:";

    /**
     * h5登录用户 redis key
     */
    public static final String API_LOGIN_TOKEN_KEY = "api_login_tokens:";

    /**
     * 防重提交 redis key
     */
    public static final String REPEAT_SUBMIT_KEY = "repeat_submit:";

    /**
     * 限流 redis key
     */
    public static final String RATE_LIMIT_KEY = "rate_limit:";

    /**
     * 验证码有效期（分钟）
     */
    public static final Integer CAPTCHA_EXPIRATION = 5;

    /**
     * 验证码发送成功标识
     */
    public static final String PHONE_CODE_SUCCESS = "000000";


    /**
     * 令牌
     */
    public static final String TOKEN = "token";

    /**
     * 令牌前缀
     */
    public static final String TOKEN_PREFIX = "Bearer";

    /**
     * 令牌前缀
     */
    public static final String LOGIN_USER_KEY = "login_user_key";

    /**
     * 令牌前缀
     */
    public static final String API_LOGIN_USER_KEY = "api_login_user_key";

    /**
     * 用户ID
     */
    public static final String JWT_USERID = "userid";

    /**
     * 用户名称
     */
    public static final String JWT_USERNAME = Claims.SUBJECT;

    /**
     * 用户头像
     */
    public static final String JWT_AVATAR = "avatar";

    /**
     * 创建时间
     */
    public static final String JWT_CREATED = "created";

    /**
     * 用户权限
     */
    public static final String JWT_AUTHORITIES = "authorities";

    /**
     * 参数管理 cache key
     */
    public static final String SYS_CONFIG_KEY = "sys_config:";

    /**
     * 字典管理 cache key
     */
    public static final String SYS_DICT_KEY = "sys_dict:";

    /**
     * 资源映射路径 前缀
     */
    public static final String RESOURCE_PREFIX = "/profile";

    /**
     * RMI 远程方法调用
     */
    public static final String LOOKUP_RMI = "rmi://";

    /**
     * LDAP 远程方法调用
     */
    public static final String LOOKUP_LDAP = "ldap://";

    /**
     * 定时任务违规的字符
     */
    public static final String[] JOB_ERROR_STR = {"java.net.URL" , "javax.naming.InitialContext" , "org.yaml.snakeyaml" ,
            "org.springframework.jndi"};
    /**
     * 账户导入模板 样例数据 部门编号
     */
    public static final String EXAMPLE_SYS_USER_DEPT_ID = "100";

    /**
     * 账户导入模板 样例数据 登录名称
     */
    public static final String EXAMPLE_SYS_USERNAME = "test";

    /**
     * 账户导入模板 样例数据 用户名称
     */
    public static final String EXAMPLE_SYS_USER_NICKNAME = "测试用户";

    /**
     * 账户导入模板 样例数据 用户邮箱
     */
    public static final String EXAMPLE_SYS_USER_EMAIL = "123@qq.com";

    /**
     * 账户导入模板 样例数据 手机号
     */
    public static final String EXAMPLE_SYS_PHONE = "15777777777";

    /**
     * 账户导入模板 样例数据 部门编号
     */
    public static final String EXAMPLE_SYS_USER_ROLE_NAMES = "测试角色、普通角色";


    /**审核通过*/
    public static final String AUDIT_STATUS_PASS = "1";
    /**审核不通过*/
    public static final String AUDIT_STATUS_NOT_PASS = "2";

    /**状态-正常*/
    public static final String STATUS_NORMAL = "0";
    public static final String APPLET_WX_PAY_MAP = "applet_wx_pay_codes:";
    /**
     * 注册短信验证码 redis key
     */
    public static final String REGISTER_CACHE_PHONE_CODE_KEY = "register_phone_captcha_codes:";

    public static final String APPLET_CACHE_PHONE_CODE_KEY = "applet_phone_captcha_codes:";

    public static final String LOGIN_CACHE_PHONE_CODE_KEY = "login_phone_captcha_codes:";

    public static final String UPDATE_CACHE_PHONE_CODE_KEY = "update_phone_captcha_codes:";

    /**默认注册验证码*/
    public static final String DEFAULT_REGISTER_CODE = "666666";

    /**默认登录验证码*/
    public static final String DEFAULT_LOGIN_CODE = "999999";

    /**注册*/
    public static final String TYPE_REGISTER = "register";

    /**登录*/
    public static final String TYPE_LOGIN = "login";

    public static final String TYPE_UPDATE_PHONE = "updatePhone";

    /**审核状态-待审核*/
    public static final String AUDIT_STATUS_WAIT = "0";

    /**审核状态-审核通过*/
    public static final String AUDIT_STATUS_SUCCESS = "1";

    /**审核状态-审核失败*/
    public static final String AUDIT_STATUS_REJECT = "2";

    /**是否实名-否*/
    public static final String IS_VERIFIED_NO = "0";

    /**是否实名-是*/
    public static final String IS_VERIFIED_YES = "1";

    public static final String GROUP_LETTER_CITY = "city:groupCityList";


    /**服务*/
    public static final String TYPE_SERVICE = "1";
    /**套餐*/
    public static final String TYPE_COMBO = "2";



    /**微信支付*/
    public static final String PAY_TYPE_WX = "WX_PAY";
    /**微信支付*/
    public static final String PAY_TYPE_WX_APPLET = "WX_APPLET_PAY";
    /**支付宝支付*/
    public static final String PAY_TYPE_ALIPAY = "ALI_PAY";
    /**注销状态-未注销*/
    public static final String LOGOUT_STATUS_NO = "0";
    /**注销状态-已注销*/
    public static final String LOGOUT_STATUS_YES = "1";

}
